package com.ycd.com.ycd.feignclient;

import com.ycd.domain.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/** 指定此接口是Feign接口 */
@FeignClient(value = "user-server",fallbackFactory  = UserFallbackFactory.class)
@RequestMapping("/user")
public interface UserFeignClient {

    /**
     * 要调谁就复制谁，将方法体删掉
     *
     * 代理接口注意事项：
     *  1.
     *  2.
     *  3.
     *  4.
     *
     * @param id
     * @return
     */
    @GetMapping("/add/{id}")
    User add(@PathVariable("id") Long id);
}
